package cn.dliyy.warehouse.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.stereotype.Component;

import cn.dliyy.base.bean.IdAI;

@Entity
@Component
@Table
public class BGoods extends IdAI {
  private static final long serialVersionUID = -2988700858733815073L;
  /** name property */
  @Column
  @Length(min = 1, max = 45)
  private String name;
  /** specification 规格 property */
  @Column
  @Length(max = 45)
  private String specification;

  /** categoryId property */
  @NotEmpty
  @Length(max = 11)
  @ManyToOne(cascade = { CascadeType.ALL })
  @JoinColumn(name = "categoryId")
  private BCategory category;

  /** unitId property */
  @Length(max = 11)
  @ManyToOne(cascade = { CascadeType.ALL })
  @JoinColumn(name = "unitId")
  private BUnit bunit;

  public BCategory getCategory() {
    return category;
  }

  public void setCategory(BCategory category) {
    this.category = category;
  }

  public BUnit getBunit() {
    return bunit;
  }

  public void setBunit(BUnit bunit) {
    this.bunit = bunit;
  }

  /** notes property */
  @Column
  @Length(max = 45)
  private String notes;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSpecification() {
    return specification;
  }

  public void setSpecification(String specification) {
    this.specification = specification;
  }

  public String getNotes() {
    return notes;
  }

  public void setNotes(String notes) {
    this.notes = notes;
  }

}
